\hypertarget{class_r_t_o_s_1_1timer}{\section{R\-T\-O\-S\-:\-:timer Class Reference}
\label{class_r_t_o_s_1_1timer}\index{R\-T\-O\-S\-::timer@{R\-T\-O\-S\-::timer}}
}


one-\/short timer  




{\ttfamily \#include $<$p\-R\-T\-O\-S.\-h$>$}

Inheritance diagram for R\-T\-O\-S\-:\-:timer\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{class_r_t_o_s_1_1timer}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_r_t_o_s_1_1timer_a5a2a759e35dd9d7cea8971db60fbe741}{\hyperlink{class_r_t_o_s_1_1timer_a5a2a759e35dd9d7cea8971db60fbe741}{timer} (\hyperlink{class_r_t_o_s_1_1task}{task} $\ast$\hyperlink{class_r_t_o_s_1_1event_a1402687edb26c1d5d26e54dbda21919d}{t}, const char $\ast$name=\char`\"{}\char`\"{})}\label{class_r_t_o_s_1_1timer_a5a2a759e35dd9d7cea8971db60fbe741}

\begin{DoxyCompactList}\small\item\em create a timer for task t, specify its name \end{DoxyCompactList}\item 
void \hyperlink{class_r_t_o_s_1_1timer_ae3507bb8a4384466d4b1a48098ae038f}{set} (unsigned long long int time)
\begin{DoxyCompactList}\small\item\em set the timer to timeout after the specified time \end{DoxyCompactList}\item 
void \hyperlink{class_r_t_o_s_1_1timer_a6df8dddc38d933432131efba05168d10}{cancel} (void)
\begin{DoxyCompactList}\small\item\em stop and clear the timer \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1timer_aca6725d409de3630e4b8b7883dacbc4f}{void \hyperlink{class_r_t_o_s_1_1timer_aca6725d409de3630e4b8b7883dacbc4f}{print} (std\-::ostream \&s, bool header=true) const }\label{class_r_t_o_s_1_1timer_aca6725d409de3630e4b8b7883dacbc4f}

\begin{DoxyCompactList}\small\item\em print the timer (for debugging) \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_r_t_o_s_1_1timer_aa5b30b5b619f01a5d94b779bf0e58610}{class {\bfseries R\-T\-O\-S}}\label{class_r_t_o_s_1_1timer_aa5b30b5b619f01a5d94b779bf0e58610}

\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
one-\/short timer 

\begin{DoxyVerb}  A (one-shot) timer is a special type of flag, which can be 
  instructed to set itself after a fixed amount of time. 
  The amount of time is supplied with the timer::set() call. 
  This call starts the timer. 
  A timer that is running (waiting for its timeout to expire) 
  can be canceled by the timer::cancel() call. 
  When a timer that is already running is set again the previous 
  timeout is overwritten by the new one. 
  The suspend/resume state of its owner taks has no effect on 
  a timer: even when the task is suspended the timer will run 
  to its timeout and set isetlf. 
  But of course the task, being suspended, will not be able to react.

  The example below again (like the flags example) produces 
  a left-shifting polarity-flipping Kitt display, but the 
  actions are now caused by two timers inside the one task. 
  Note that these timers must be started initially, 
  and must be re-started after each timeout.

  @code 
\end{DoxyVerb}
 T\-B\-W  

\subsection{Member Function Documentation}
\hypertarget{class_r_t_o_s_1_1timer_a6df8dddc38d933432131efba05168d10}{\index{R\-T\-O\-S\-::timer@{R\-T\-O\-S\-::timer}!cancel@{cancel}}
\index{cancel@{cancel}!RTOS::timer@{R\-T\-O\-S\-::timer}}
\subsubsection[{cancel}]{\setlength{\rightskip}{0pt plus 5cm}void R\-T\-O\-S\-::timer\-::cancel (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{class_r_t_o_s_1_1timer_a6df8dddc38d933432131efba05168d10}


stop and clear the timer 

Stop the timer (when it was running), and clears its (when it was set). \hypertarget{class_r_t_o_s_1_1timer_ae3507bb8a4384466d4b1a48098ae038f}{\index{R\-T\-O\-S\-::timer@{R\-T\-O\-S\-::timer}!set@{set}}
\index{set@{set}!RTOS::timer@{R\-T\-O\-S\-::timer}}
\subsubsection[{set}]{\setlength{\rightskip}{0pt plus 5cm}void R\-T\-O\-S\-::timer\-::set (
\begin{DoxyParamCaption}
\item[{unsigned long long int}]{time}
\end{DoxyParamCaption}
)}}\label{class_r_t_o_s_1_1timer_ae3507bb8a4384466d4b1a48098ae038f}


set the timer to timeout after the specified time 

Start the timer\-: it will set itself after the indicated timeout, starting from now. When the timer was already running the previous timout is overwritten. 

The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
p\-R\-T\-O\-S.\-h\item 
p\-R\-T\-O\-S.\-cpp\end{DoxyCompactItemize}
